# coding:utf8
import os

headers = {
    "Accept": "*/*",
    "User-Agent": "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET4.0C; .NET4.0E)",
    "Accept-Language": "zh-cn",
    "x-requested-with": "XMLHttpRequest",
    "Cookie":"JSESSIONID=0001DPkc0CydQOras4H-mxxhXUh:2K3BERTIDU" #此系统会话固定 只要登录即可使用session生效
}

CJBX_PLATE_NUMBER="CJBX_PLATE_NUMBER"
MQIP='120.55.189.14'
MQPORT=61613
MQHOST='tcp://120.55.189.14:61613'
# 开发环境
class Production:
    host = '120.55.189.14'
    user = 'insurance'
    password = 'insurance'
    db = 'insurance'


# 本地测试
class Local:
    host = 'localhost'
    user = 'root'
    password = '1234'
    db = 'qiche'


def import_string(import_name):
    try:
        module_name, obj_name = import_name.rsplit('.', 1)
        module = __import__(module_name, None, None, [obj_name])
        return getattr(module, obj_name)
    except Exception as e:
        print e



# 通过环境变量来进行配置切换
#env = os.environ.get('NANMI', '')
#if not env:
#    env = 'Production'

#if env not in ['Local', 'Test' 'Production']:
 #   raise EnvironmentError('The environment variable (NANMI) is invalid ')
env='Production'
config = import_string('settings.{0}'.format(env))
